package com.dangdang.sharding.dp.filter.spring.core;

import org.springframework.stereotype.Component;

import com.dangdang.sharding.dp.filter.dp.Filter;
import com.dangdang.sharding.dp.filter.dp.FilterChain;
import com.dangdang.sharding.dp.filter.dp.Request;
import com.dangdang.sharding.dp.filter.dp.Response;

@Component
public class InterceptorRegistry {
	private  FilterChain fc = new FilterChain();

	public FilterChain addFilter(Filter f) {
		fc.addFilter(f);
		return fc;
	}

	public void doFilter(Request request, Response response) {
		fc.doFilter(request, response, fc);
	}
}
